from rest_framework.generics import ListCreateAPIView

from books.models import HeroInfo
from heros.serialziers import HeroSerializer


class HerosView(ListCreateAPIView):
    """
        获取所有英雄和保存英雄的业务
    """
    # 指定查询集属性 查询对应的模型类数据
    queryset = HeroInfo.objects.all()
    # 指定序列化器
    serializer_class = HeroSerializer
